<form method="post" id="frmIntroduce" name="frmIntroduce" action="{$smarty.const.HOST_VFRIEND}account/basicsave" enctype="multipart/form-data">
    <input type="hidden" name="ptsave" id="ptsave" value="{$intType}" />
	<div class="editForm">    	
        <div class="userInput txt">
        	<div class="lFloat w100pe"><label class="w100pe txt" for="pintroduce">Tự giới thiệu<span class="rFloat">Bạn đã nhập <span id="introCount">0</span> ký tự</span></label></div>
            <textarea rows="0" cols="0" name="pintroduce" id="pintroduce" class="textarea clearIt">{if isset($smarty.session.st_introduce)}{$smarty.session.st_introduce}{else}{$objUser->introduce}{/if}</textarea>
        </div>        
        <div class="userInput">
        	<input type="submit" value="Thay đổi" class="btnSubmit lMargin0" />
            <input type="button" value="Hủy" class="btnCancel" onclick="javascript:basicClose('{$strView}','{$strEdit}')" />
        </div>
    </div>
</form>
<script type="text/javascript" language="javascript" src="{$smarty.const.HOST_STATICS}js/library/autoresize.jquery.js"></script>
{literal}
<script type="text/javascript" language="javascript">
	$(document).ready(function(){		
		$("#frmIntroduce").validate({						
			errorClass		: "errorMessage",
			errorElement	: "span",
			onfocusout		: false,
			onkeyup			: false,
			rules: {	
				pintroduce:{
					required	: true,
					minlength	: 10
				}
			},
			messages: {	
				pintroduce:{
					required	: introduce_required,
					minlength	: introduce_minlength
				}
			},		
			errorPlacement: function(label, element) {			
				var id = element.attr("id");			
				label.insertAfter($("#" + id));			
			},
			submitHandler: function(form) {		
				form.submit();
			}
		});		
		$("textarea#pintroduce").autoResize({
			// On resize:
			onResize : function() {
				$(this).css({opacity:0.8});
			},
			// After resize:
			animateCallback : function() {
				$(this).css({opacity:1});
			},
			// Quite slow animation:
			animateDuration : 300,
			// More extra space:
			extraSpace : 5
		});
		$("#pintroduce").each(function(){  
			var length = $(this).val().length;		
			$(this).parent().find("#introCount").html( length);  
			$(this).keyup(function(){  			
				var new_length = $(this).val().length; 
				$(this).parent().find("#introCount").html( new_length);  
			});  
			
		});  
	});
</script>
{/literal}